<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Remote Control: Client.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Remote Control
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.2 -->
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('_client_8h_source.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">Client.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#ifndef CLIENT_H</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define CLIENT_H</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &lt;list&gt;</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_object_8h.html" title="Header for the Object class.">Object.h</a>&quot;</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#include &quot;RemoteControl.h&quot;</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#include &quot;IDevice.h&quot;</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;</div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">//typedef for a list of data type Device*</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="keyword">typedef</span> std::list&lt;IDevice*&gt; TDevices;</div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;</div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">//typedef for a list of data type ICommand*</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="keyword">typedef</span> std::list&lt;ICommand*&gt; TCommands;</div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;</div>
<div class="line"><a name="l00029"></a><span class="lineno"><a class="code" href="class_client.html">   29</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_client.html" title="The Client manages all devices and implements a menu for using the remote control.">Client</a> : <span class="keyword">public</span> <a class="code" href="class_object.html" title="Common Baseclass for all other classes.">Object</a>{</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;   <span class="keywordtype">void</span> <a class="code" href="class_client.html#a9de8da96f3e9d600955ec1b6e5f6b7e6" title="Add a device to the client.">AddDevice</a>(<a class="code" href="class_i_device.html" title="Header for the IDevice class.">IDevice</a> * dev);</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;   <span class="keywordtype">void</span> <a class="code" href="class_client.html#a4adc2108ce9f051b7f6cb150894a419c" title="Program the remote control.">ProgramRemoteControl</a>();</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;   <span class="keywordtype">void</span> <a class="code" href="class_client.html#af90a95f5a7a60d04588c222d3817cfcf" title="Function used for the interactive menu.">UseRemoteControl</a>();</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;   <span class="comment">//Frees all lists used by the Client</span></div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;   <span class="keywordtype">void</span> FreeLists();</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;   <span class="comment">//free a device</span></div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;   <span class="keyword">static</span> <span class="keywordtype">void</span> DeleteDevice(<a class="code" href="class_i_device.html" title="Header for the IDevice class.">IDevice</a> * dev);</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;   <span class="comment">//free a command</span></div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;   <span class="keyword">static</span> <span class="keywordtype">void</span> DeleteCommand(<a class="code" href="class_i_command.html" title="Header for the ICommand interfaceclass.">ICommand</a> * com);</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;   <span class="comment">//Add a command to the list of Commands</span></div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;   <span class="keywordtype">void</span> AddCommand(<a class="code" href="class_i_command.html" title="Header for the ICommand interfaceclass.">ICommand</a> * com);</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;   <span class="comment">//Print the user menu including the devices</span></div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;   <span class="comment">//and slot position on the remote control</span></div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;   <span class="keywordtype">void</span> PrintInterface();</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;   <span class="comment">//Function used in for_each to output device info</span></div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;   <span class="keyword">static</span> <span class="keywordtype">void</span> PrintDevice(<a class="code" href="class_i_device.html" title="Header for the IDevice class.">IDevice</a> * dev);</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;   <span class="comment">//list of devices in the client</span></div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;   <span class="comment">//also used to free the devices</span></div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;   TDevices mDevices;</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;   <span class="comment">//commands that are used for the remote control</span></div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;   <span class="comment">//list for freeing the commands</span></div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;   TCommands mCommands;</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;   <span class="comment">//remote control used by the client</span></div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;   <a class="code" href="class_remote_control.html" title="RemoteControl is able to remotely command devices it is programmed for.">RemoteControl</a> mRemoteControl;</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;};</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;<span class="preprocessor">#endif</span></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><b>Client.h</b></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.2 </li>
  </ul>
</div>
</body>
</html>
